package utils;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;


public class SosUtils {

	public ImageIcon createImageIcon(String path) {
        java.net.URL imgURL = getClass().getClassLoader().getResource(path);
        if (imgURL != null) {
            return new ImageIcon(imgURL);
        } else {
            System.err.println("Couldn't find file: " + path);
            return null;
        }
    }
	

	public String intToString(int i) {
		StringBuilder sb = new StringBuilder();
		sb.append("");
		sb.append(i);
		String strI = sb.toString();
		return strI;
	}
	
	public ImageIcon getPicture(String path) throws IOException {
		File imgPath = new File(path);
		BufferedImage img = ImageIO.read(imgPath);
		return new ImageIcon(img);
	}
	
}
